From a687e0227cee80ee2225fd6cd02d34259269edd5 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Tue, 14 Jul 2026 16:57:30 +0000 Subject: [PATCH] Use Sphinx replacements for macro constants used in Sphinx tables --- doc/src/epilog.inc.m4 | 22 ++++++++++++++++++++++ doc/src/views/biography.m4 | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index 3d5c639..fe0925c 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -843,4 +843,26 @@ sdb_generated_rst()dnl .. |double precision floating point number| replace:: `double precision floating point number`_ +.. +.. A set of replacement text for macro constant values. +.. +.. The point here is to have Sphinx replacements that reference macros + that produce constant values. The reason is because when macros + are expanded, the length of the expanded text can differ from the + length of the replaced symbol. This makes construction of Sphinx/RST + tables annoying, because they rely on having column delimiters that + align. But Sphinx is smart enough that when replacement text appears + in a table, the length of the replacement syntax is what matters. +.. +.. The only constants that appear here are those used in RST tables. + This keeps it simple. +.. +.. The replacement text uses the prefix "spx_" for the replacement symbol + instead of the macro's prefix, "sdb_". +.. +.. The replacement text formats the constants as code. + +.. |spx_dad_prelim| replace:: ``sdb_dad_prelim`` + + sdb_if_htmlout(*m4[Page last generated: |today|]m4*, *m4[]m4*) diff --git a/doc/src/views/biography.m4 b/doc/src/views/biography.m4 index 91d5e50..5427f85 100644 --- a/doc/src/views/biography.m4 +++ b/doc/src/views/biography.m4 @@ -78,7 +78,7 @@ Columns of the BIOGRAPHY View +-------------+-------------------------------------------------+---------------------------------------------------------------------+ | DadID || |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadID| | |BIOGRAPHY_DATA.AnimID| of the individual's father, | | || |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadStatus| | suffixed with ``_prelim`` if |BIOGRAPHY_DATA.DadStatus| | - | || | is ``sdb_dad_prelim`` | + | || | is |spx_dad_prelim| | +-------------+-------------------------------------------------+---------------------------------------------------------------------+ | DadIDPub | |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadIDPub| | Publication of Paternity citation | +-------------+-------------------------------------------------+---------------------------------------------------------------------+ -- 2.34.1